local ffi = require 'ffi'
ffi.cdef[[
/* + BEGIN /usr/include/netcdf.h */
/* ++ BEGIN /usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h */
]] require 'ffi.req' 'c.stddef' ffi.cdef[[
/* ++ END   /usr/lib/gcc/x86_64-linux-gnu/13/include/stddef.h */
/* ++ BEGIN /usr/include/errno.h */
]] require 'ffi.req' 'c.errno' ffi.cdef[[
/* ++ END   /usr/include/errno.h */
typedef int nc_type;
enum { NC_NAT = 0 };
enum { NC_BYTE = 1 };
enum { NC_CHAR = 2 };
enum { NC_SHORT = 3 };
enum { NC_INT = 4 };
enum { NC_LONG = 4 };
enum { NC_FLOAT = 5 };
enum { NC_DOUBLE = 6 };
enum { NC_UBYTE = 7 };
enum { NC_USHORT = 8 };
enum { NC_UINT = 9 };
enum { NC_INT64 = 10 };
enum { NC_UINT64 = 11 };
enum { NC_STRING = 12 };
enum { NC_MAX_ATOMIC_TYPE = 12 };
enum { NC_VLEN = 13 };
enum { NC_OPAQUE = 14 };
enum { NC_ENUM = 15 };
enum { NC_COMPOUND = 16 };
enum { NC_FIRSTUSERTYPEID = 32 };
/* #define NC_FILL_BYTE    ((signed char)-127) ### string, not number "((signed char)-127)" */
/* #define NC_FILL_CHAR    ((char)0) ### string, not number "((char)0)" */
enum { NC_FILL_SHORT = -32767 };
enum { NC_FILL_INT = -2147483647 };
/* #define NC_FILL_FLOAT   (9.9692099683868690e+36f) ### string, not number "(9.9692099683868690e+36f)" */
/* #define NC_FILL_DOUBLE  (9.9692099683868690e+36) ### string, not number "(9.9692099683868690e+36)" */
enum { NC_FILL_UBYTE = 255 };
enum { NC_FILL_USHORT = 65535 };
enum { NC_FILL_UINT = 4294967295 };
/* #define NC_FILL_INT64   ((long long)-9223372036854775806LL) ### string, not number "((long long)-9223372036854775806LL)" */
/* #define NC_FILL_UINT64  ((unsigned long long)18446744073709551614ULL) ### string, not number "((unsigned long long)18446744073709551614ULL)" */
/* #define NC_FILL_STRING  ((char *)"") ### string, not number "((char *)\"\")" */
enum { NC_MAX_BYTE = 127 };
enum { NC_MIN_BYTE = -128 };
enum { NC_MAX_CHAR = 255 };
enum { NC_MAX_SHORT = 32767 };
enum { NC_MIN_SHORT = -32768 };
enum { NC_MAX_INT = 2147483647 };
enum { NC_MIN_INT = -2147483648 };
/* #define NC_MAX_FLOAT 3.402823466e+38f ### string, not number "3.402823466e+38f" */
/* #define NC_MIN_FLOAT (-NC_MAX_FLOAT) ### string, not number "(-NC_MAX_FLOAT)" */
/* #define NC_MAX_DOUBLE 1.7976931348623157e+308 ### string, not number "1.7976931348623157e+308" */
/* #define NC_MIN_DOUBLE (-NC_MAX_DOUBLE) ### string, not number "(-NC_MAX_DOUBLE)" */
enum { NC_MAX_UBYTE = 255 };
enum { NC_MAX_USHORT = 65535 };
enum { NC_MAX_UINT = 4294967295 };
/* #define NC_MAX_INT64 (9223372036854775807LL) ### string, not number "9.2233720368548e+18" */
/* #define NC_MIN_INT64 (-9223372036854775807LL-1) ### string, not number "-9.2233720368548e+18" */
/* #define NC_MAX_UINT64 (18446744073709551615ULL) ### string, not number "(18446744073709551615ULL)" */
enum { NC_FILL = 0 };
enum { NC_NOFILL = 256 };
enum { NC_NOWRITE = 0 };
enum { NC_WRITE = 1 };
enum { NC_CLOBBER = 0 };
enum { NC_NOCLOBBER = 4 };
enum { NC_DISKLESS = 8 };
enum { NC_MMAP = 16 };
enum { NC_64BIT_DATA = 32 };
enum { NC_CDF5 = 32 };
enum { NC_UDF0 = 64 };
enum { NC_UDF1 = 128 };
enum { NC_CLASSIC_MODEL = 256 };
enum { NC_64BIT_OFFSET = 512 };
enum { NC_LOCK = 1024 };
enum { NC_SHARE = 2048 };
enum { NC_NETCDF4 = 4096 };
enum { NC_MPIIO = 8192 };
enum { NC_MPIPOSIX = 8192 };
enum { NC_PNETCDF = 8192 };
enum { NC_PERSIST = 16384 };
enum { NC_INMEMORY = 32768 };
enum { NC_NOATTCREORD = 131072 };
enum { NC_NODIMSCALE_ATTACH = 262144 };
enum { NC_MAX_MAGIC_NUMBER_LEN = 8 };
enum { NC_FORMAT_CLASSIC = 1 };
enum { NC_FORMAT_64BIT_OFFSET = 2 };
enum { NC_FORMAT_64BIT = 2 };
enum { NC_FORMAT_NETCDF4 = 3 };
enum { NC_FORMAT_NETCDF4_CLASSIC = 4 };
enum { NC_FORMAT_64BIT_DATA = 5 };
enum { NC_FORMAT_CDF5 = 5 };
enum { NC_FORMAT_ALL = 5088 };
enum { NC_FORMATX_NC3 = 1 };
enum { NC_FORMATX_NC_HDF5 = 2 };
enum { NC_FORMATX_NC4 = 2 };
enum { NC_FORMATX_NC_HDF4 = 3 };
enum { NC_FORMATX_PNETCDF = 4 };
enum { NC_FORMATX_DAP2 = 5 };
enum { NC_FORMATX_DAP4 = 6 };
enum { NC_FORMATX_UDF0 = 8 };
enum { NC_FORMATX_UDF1 = 9 };
enum { NC_FORMATX_NCZARR = 10 };
enum { NC_FORMATX_UNDEFINED = 0 };
enum { NC_FORMAT_NC3 = 1 };
enum { NC_FORMAT_NC_HDF5 = 2 };
enum { NC_FORMAT_NC4 = 2 };
enum { NC_FORMAT_NC_HDF4 = 3 };
enum { NC_FORMAT_PNETCDF = 4 };
enum { NC_FORMAT_DAP2 = 5 };
enum { NC_FORMAT_DAP4 = 6 };
enum { NC_FORMAT_UNDEFINED = 0 };
enum { NC_SIZEHINT_DEFAULT = 0 };
/* #define NC_ALIGN_CHUNK ((size_t)(-1)) ### string, not number "((size_t)(-1))" */
enum { NC_UNLIMITED = 0 };
enum { NC_GLOBAL = -1 };
enum { NC_MAX_DIMS = 1024 };
enum { NC_MAX_ATTRS = 8192 };
enum { NC_MAX_VARS = 8192 };
enum { NC_MAX_NAME = 256 };
enum { NC_MAX_VAR_DIMS = 1024 };
enum { NC_MAX_HDF4_NAME = 256 };
enum { NC_ENDIAN_NATIVE = 0 };
enum { NC_ENDIAN_LITTLE = 1 };
enum { NC_ENDIAN_BIG = 2 };
enum { NC_CHUNKED = 0 };
enum { NC_CONTIGUOUS = 1 };
enum { NC_COMPACT = 2 };
enum { NC_UNKNOWN_STORAGE = 3 };
enum { NC_VIRTUAL = 4 };
enum { NC_NOCHECKSUM = 0 };
enum { NC_FLETCHER32 = 1 };
enum { NC_NOSHUFFLE = 0 };
enum { NC_SHUFFLE = 1 };
enum { NC_MIN_DEFLATE_LEVEL = 0 };
enum { NC_MAX_DEFLATE_LEVEL = 9 };
enum { NC_SZIP_NN = 32 };
enum { NC_SZIP_EC = 4 };
enum { NC_NOQUANTIZE = 0 };
enum { NC_QUANTIZE_BITGROOM = 1 };
enum { NC_QUANTIZE_GRANULARBR = 2 };
enum { NC_QUANTIZE_BITROUND = 3 };
/* #define NC_QUANTIZE_BITGROOM_ATT_NAME "_QuantizeBitGroomNumberOfSignificantDigits" ### string, not number "\"_QuantizeBitGroomNumberOfSignificantDigits\"" */
/* #define NC_QUANTIZE_GRANULARBR_ATT_NAME "_QuantizeGranularBitRoundNumberOfSignificantDigits" ### string, not number "\"_QuantizeGranularBitRoundNumberOfSignificantDigits\"" */
/* #define NC_QUANTIZE_BITROUND_ATT_NAME "_QuantizeBitRoundNumberOfSignificantBits" ### string, not number "\"_QuantizeBitRoundNumberOfSignificantBits\"" */
enum { NC_QUANTIZE_MAX_FLOAT_NSD = 7 };
enum { NC_QUANTIZE_MAX_FLOAT_NSB = 23 };
enum { NC_QUANTIZE_MAX_DOUBLE_NSD = 15 };
enum { NC_QUANTIZE_MAX_DOUBLE_NSB = 52 };
enum { NC_NOERR = 0 };
enum { NC2_ERR = -1 };
enum { NC_EBADID = -33 };
enum { NC_ENFILE = -34 };
enum { NC_EEXIST = -35 };
enum { NC_EINVAL = -36 };
enum { NC_EPERM = -37 };
enum { NC_ENOTINDEFINE = -38 };
enum { NC_EINDEFINE = -39 };
enum { NC_EINVALCOORDS = -40 };
enum { NC_EMAXDIMS = -41 };
enum { NC_ENAMEINUSE = -42 };
enum { NC_ENOTATT = -43 };
enum { NC_EMAXATTS = -44 };
enum { NC_EBADTYPE = -45 };
enum { NC_EBADDIM = -46 };
enum { NC_EUNLIMPOS = -47 };
enum { NC_EMAXVARS = -48 };
enum { NC_ENOTVAR = -49 };
enum { NC_EGLOBAL = -50 };
enum { NC_ENOTNC = -51 };
enum { NC_ESTS = -52 };
enum { NC_EMAXNAME = -53 };
enum { NC_EUNLIMIT = -54 };
enum { NC_ENORECVARS = -55 };
enum { NC_ECHAR = -56 };
enum { NC_EEDGE = -57 };
enum { NC_ESTRIDE = -58 };
enum { NC_EBADNAME = -59 };
enum { NC_ERANGE = -60 };
enum { NC_ENOMEM = -61 };
enum { NC_EVARSIZE = -62 };
enum { NC_EDIMSIZE = -63 };
enum { NC_ETRUNC = -64 };
enum { NC_EAXISTYPE = -65 };
enum { NC_EDAP = -66 };
enum { NC_ECURL = -67 };
enum { NC_EIO = -68 };
enum { NC_ENODATA = -69 };
enum { NC_EDAPSVC = -70 };
enum { NC_EDAS = -71 };
enum { NC_EDDS = -72 };
enum { NC_EDMR = -72 };
enum { NC_EDATADDS = -73 };
enum { NC_EDATADAP = -73 };
enum { NC_EDAPURL = -74 };
enum { NC_EDAPCONSTRAINT = -75 };
enum { NC_ETRANSLATION = -76 };
enum { NC_EACCESS = -77 };
enum { NC_EAUTH = -78 };
enum { NC_ENOTFOUND = -90 };
enum { NC_ECANTREMOVE = -91 };
enum { NC_EINTERNAL = -92 };
enum { NC_EPNETCDF = -93 };
enum { NC4_FIRST_ERROR = -100 };
enum { NC_EHDFERR = -101 };
enum { NC_ECANTREAD = -102 };
enum { NC_ECANTWRITE = -103 };
enum { NC_ECANTCREATE = -104 };
enum { NC_EFILEMETA = -105 };
enum { NC_EDIMMETA = -106 };
enum { NC_EATTMETA = -107 };
enum { NC_EVARMETA = -108 };
enum { NC_ENOCOMPOUND = -109 };
enum { NC_EATTEXISTS = -110 };
enum { NC_ENOTNC4 = -111 };
enum { NC_ESTRICTNC3 = -112 };
enum { NC_ENOTNC3 = -113 };
enum { NC_ENOPAR = -114 };
enum { NC_EPARINIT = -115 };
enum { NC_EBADGRPID = -116 };
enum { NC_EBADTYPID = -117 };
enum { NC_ETYPDEFINED = -118 };
enum { NC_EBADFIELD = -119 };
enum { NC_EBADCLASS = -120 };
enum { NC_EMAPTYPE = -121 };
enum { NC_ELATEFILL = -122 };
enum { NC_ELATEDEF = -123 };
enum { NC_EDIMSCALE = -124 };
enum { NC_ENOGRP = -125 };
enum { NC_ESTORAGE = -126 };
enum { NC_EBADCHUNK = -127 };
enum { NC_ENOTBUILT = -128 };
enum { NC_EDISKLESS = -129 };
enum { NC_ECANTEXTEND = -130 };
enum { NC_EMPI = -131 };
enum { NC_EFILTER = -132 };
enum { NC_ERCFILE = -133 };
enum { NC_ENULLPAD = -134 };
enum { NC_EINMEMORY = -135 };
enum { NC_ENOFILTER = -136 };
enum { NC_ENCZARR = -137 };
enum { NC_ES3 = -138 };
enum { NC_EEMPTY = -139 };
enum { NC_EOBJECT = -140 };
enum { NC_ENOOBJECT = -141 };
enum { NC_EPLUGIN = -142 };
enum { NC4_LAST_ERROR = -142 };
enum { NC_EURL = -74 };
enum { NC_ECONSTRAINT = -75 };
/* #define DIM_WITHOUT_VARIABLE "This is a netCDF dimension but not a netCDF variable." ### string, not number "\"This is a netCDF dimension but not a netCDF variable.\"" */
enum { NC_HAVE_NEW_CHUNKING_API = 1 };
enum { MSC_EXTRA = 1 };
extern const char * nc_inq_libvers(void);
extern const char * nc_strerror(int ncerr);
typedef struct NC_Dispatch NC_Dispatch;
extern int nc_def_user_format(int mode_flag, NC_Dispatch *dispatch_table, char *magic_number);
extern int nc_inq_user_format(int mode_flag, NC_Dispatch **dispatch_table, char *magic_number);
extern int nc_set_alignment(int threshold, int alignment);
extern int nc_get_alignment(int* thresholdp, int* alignmentp);
extern int nc__create(const char *path, int cmode, size_t initialsz, size_t *chunksizehintp, int *ncidp);
extern int nc_create(const char *path, int cmode, int *ncidp);
extern int nc__open(const char *path, int mode, size_t *chunksizehintp, int *ncidp);
extern int nc_open(const char *path, int mode, int *ncidp);
extern int nc_inq_path(int ncid, size_t *pathlen, char *path);
extern int nc_inq_ncid(int ncid, const char *name, int *grp_ncid);
extern int nc_inq_grps(int ncid, int *numgrps, int *ncids);
extern int nc_inq_grpname(int ncid, char *name);
extern int nc_inq_grpname_full(int ncid, size_t *lenp, char *full_name);
extern int nc_inq_grpname_len(int ncid, size_t *lenp);
extern int nc_inq_grp_parent(int ncid, int *parent_ncid);
extern int nc_inq_grp_ncid(int ncid, const char *grp_name, int *grp_ncid);
extern int nc_inq_grp_full_ncid(int ncid, const char *full_name, int *grp_ncid);
extern int nc_inq_varids(int ncid, int *nvars, int *varids);
extern int nc_inq_dimids(int ncid, int *ndims, int *dimids, int include_parents);
extern int nc_inq_typeids(int ncid, int *ntypes, int *typeids);
extern int nc_inq_type_equal(int ncid1, nc_type typeid1, int ncid2, nc_type typeid2, int *equal);
extern int nc_def_grp(int parent_ncid, const char *name, int *new_ncid);
extern int nc_rename_grp(int grpid, const char *name);
extern int nc_def_compound(int ncid, size_t size, const char *name, nc_type *typeidp);
extern int nc_insert_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid);
extern int nc_insert_array_compound(int ncid, nc_type xtype, const char *name, size_t offset, nc_type field_typeid, int ndims, const int *dim_sizes);
extern int nc_inq_type(int ncid, nc_type xtype, char *name, size_t *size);
extern int nc_inq_typeid(int ncid, const char *name, nc_type *typeidp);
extern int nc_inq_compound(int ncid, nc_type xtype, char *name, size_t *sizep, size_t *nfieldsp);
extern int nc_inq_compound_name(int ncid, nc_type xtype, char *name);
extern int nc_inq_compound_size(int ncid, nc_type xtype, size_t *sizep);
extern int nc_inq_compound_nfields(int ncid, nc_type xtype, size_t *nfieldsp);
extern int nc_inq_compound_field(int ncid, nc_type xtype, int fieldid, char *name, size_t *offsetp, nc_type *field_typeidp, int *ndimsp, int *dim_sizesp);
extern int nc_inq_compound_fieldname(int ncid, nc_type xtype, int fieldid, char *name);
extern int nc_inq_compound_fieldindex(int ncid, nc_type xtype, const char *name, int *fieldidp);
extern int nc_inq_compound_fieldoffset(int ncid, nc_type xtype, int fieldid, size_t *offsetp);
extern int nc_inq_compound_fieldtype(int ncid, nc_type xtype, int fieldid, nc_type *field_typeidp);
extern int nc_inq_compound_fieldndims(int ncid, nc_type xtype, int fieldid, int *ndimsp);
extern int nc_inq_compound_fielddim_sizes(int ncid, nc_type xtype, int fieldid, int *dim_sizes);
typedef struct {
	size_t len;
	void *p;
} nc_vlen_t;
extern int nc_def_vlen(int ncid, const char *name, nc_type base_typeid, nc_type *xtypep);
extern int nc_inq_vlen(int ncid, nc_type xtype, char *name, size_t *datum_sizep, nc_type *base_nc_typep);
extern int nc_free_vlen(nc_vlen_t *vl);
extern int nc_free_vlens(size_t len, nc_vlen_t vlens[]);
extern int nc_put_vlen_element(int ncid, int typeid1, void *vlen_element, size_t len, const void *data);
extern int nc_get_vlen_element(int ncid, int typeid1, const void *vlen_element, size_t *len, void *data);
extern int nc_free_string(size_t len, char **data);
extern int nc_inq_user_type(int ncid, nc_type xtype, char *name, size_t *size, nc_type *base_nc_typep, size_t *nfieldsp, int *classp);
extern int nc_put_att(int ncid, int varid, const char *name, nc_type xtype, size_t len, const void *op);
extern int nc_get_att(int ncid, int varid, const char *name, void *ip);
extern int nc_def_enum(int ncid, nc_type base_typeid, const char *name, nc_type *typeidp);
extern int nc_insert_enum(int ncid, nc_type xtype, const char *name, const void *value);
extern int nc_inq_enum(int ncid, nc_type xtype, char *name, nc_type *base_nc_typep, size_t *base_sizep, size_t *num_membersp);
extern int nc_inq_enum_member(int ncid, nc_type xtype, int idx, char *name, void *value);
/* #define NC_UNDEFINED_ENUM_IDENT "_UNDEFINED" ### string, not number "\"_UNDEFINED\"" */
extern int nc_inq_enum_ident(int ncid, nc_type xtype, long long value, char *identifier);
extern int nc_def_opaque(int ncid, size_t size, const char *name, nc_type *xtypep);
extern int nc_inq_opaque(int ncid, nc_type xtype, char *name, size_t *sizep);
extern int nc_put_var(int ncid, int varid, const void *op);
extern int nc_get_var(int ncid, int varid, void *ip);
extern int nc_put_var1(int ncid, int varid, const size_t *indexp, const void *op);
extern int nc_get_var1(int ncid, int varid, const size_t *indexp, void *ip);
extern int nc_put_vara(int ncid, int varid, const size_t *startp, const size_t *countp, const void *op);
extern int nc_get_vara(int ncid, int varid, const size_t *startp, const size_t *countp, void *ip);
extern int nc_put_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const void *op);
extern int nc_get_vars(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, void *ip);
extern int nc_put_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const void *op);
extern int nc_get_varm(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, void *ip);
extern int nc_def_var_quantize(int ncid, int varid, int quantize_mode, int nsd);
extern int nc_inq_var_quantize(int ncid, int varid, int *quantize_modep, int *nsdp);
extern int nc_def_var_deflate(int ncid, int varid, int shuffle, int deflate, int deflate_level);
extern int nc_inq_var_deflate(int ncid, int varid, int *shufflep, int *deflatep, int *deflate_levelp);
extern int nc_def_var_szip(int ncid, int varid, int options_mask, int pixels_per_block);
extern int nc_inq_var_szip(int ncid, int varid, int *options_maskp, int *pixels_per_blockp);
extern int nc_def_var_fletcher32(int ncid, int varid, int fletcher32);
extern int nc_inq_var_fletcher32(int ncid, int varid, int *fletcher32p);
extern int nc_def_var_chunking(int ncid, int varid, int storage, const size_t *chunksizesp);
extern int nc_inq_var_chunking(int ncid, int varid, int *storagep, size_t *chunksizesp);
extern int nc_def_var_fill(int ncid, int varid, int no_fill, const void *fill_value);
extern int nc_inq_var_fill(int ncid, int varid, int *no_fill, void *fill_valuep);
extern int nc_def_var_endian(int ncid, int varid, int endian);
extern int nc_inq_var_endian(int ncid, int varid, int *endianp);
extern int nc_def_var_filter(int ncid, int varid, unsigned int id, size_t nparams, const unsigned int* parms);
extern int nc_inq_var_filter(int ncid, int varid, unsigned int* idp, size_t* nparams, unsigned int* params);
extern int nc_set_fill(int ncid, int fillmode, int *old_modep);
extern int nc_set_default_format(int format, int *old_formatp);
extern int nc_set_chunk_cache(size_t size, size_t nelems, float preemption);
extern int nc_get_chunk_cache(size_t *sizep, size_t *nelemsp, float *preemptionp);
extern int nc_set_var_chunk_cache(int ncid, int varid, size_t size, size_t nelems, float preemption);
extern int nc_get_var_chunk_cache(int ncid, int varid, size_t *sizep, size_t *nelemsp, float *preemptionp);
extern int nc_redef(int ncid);
extern int nc__enddef(int ncid, size_t h_minfree, size_t v_align, size_t v_minfree, size_t r_align);
extern int nc_enddef(int ncid);
extern int nc_sync(int ncid);
extern int nc_abort(int ncid);
extern int nc_close(int ncid);
extern int nc_inq(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimidp);
extern int nc_inq_ndims(int ncid, int *ndimsp);
extern int nc_inq_nvars(int ncid, int *nvarsp);
extern int nc_inq_natts(int ncid, int *nattsp);
extern int nc_inq_unlimdim(int ncid, int *unlimdimidp);
extern int nc_inq_unlimdims(int ncid, int *nunlimdimsp, int *unlimdimidsp);
extern int nc_inq_format(int ncid, int *formatp);
extern int nc_inq_format_extended(int ncid, int *formatp, int* modep);
extern int nc_def_dim(int ncid, const char *name, size_t len, int *idp);
extern int nc_inq_dimid(int ncid, const char *name, int *idp);
extern int nc_inq_dim(int ncid, int dimid, char *name, size_t *lenp);
extern int nc_inq_dimname(int ncid, int dimid, char *name);
extern int nc_inq_dimlen(int ncid, int dimid, size_t *lenp);
extern int nc_rename_dim(int ncid, int dimid, const char *name);
extern int nc_inq_att(int ncid, int varid, const char *name, nc_type *xtypep, size_t *lenp);
extern int nc_inq_attid(int ncid, int varid, const char *name, int *idp);
extern int nc_inq_atttype(int ncid, int varid, const char *name, nc_type *xtypep);
extern int nc_inq_attlen(int ncid, int varid, const char *name, size_t *lenp);
extern int nc_inq_attname(int ncid, int varid, int attnum, char *name);
extern int nc_copy_att(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
extern int nc_rename_att(int ncid, int varid, const char *name, const char *newname);
extern int nc_del_att(int ncid, int varid, const char *name);
extern int nc_put_att_text(int ncid, int varid, const char *name, size_t len, const char *op);
extern int nc_get_att_text(int ncid, int varid, const char *name, char *ip);
extern int nc_put_att_string(int ncid, int varid, const char *name, size_t len, const char **op);
extern int nc_get_att_string(int ncid, int varid, const char *name, char **ip);
extern int nc_put_att_uchar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op);
extern int nc_get_att_uchar(int ncid, int varid, const char *name, unsigned char *ip);
extern int nc_put_att_schar(int ncid, int varid, const char *name, nc_type xtype, size_t len, const signed char *op);
extern int nc_get_att_schar(int ncid, int varid, const char *name, signed char *ip);
extern int nc_put_att_short(int ncid, int varid, const char *name, nc_type xtype, size_t len, const short *op);
extern int nc_get_att_short(int ncid, int varid, const char *name, short *ip);
extern int nc_put_att_int(int ncid, int varid, const char *name, nc_type xtype, size_t len, const int *op);
extern int nc_get_att_int(int ncid, int varid, const char *name, int *ip);
extern int nc_put_att_long(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long *op);
extern int nc_get_att_long(int ncid, int varid, const char *name, long *ip);
extern int nc_put_att_float(int ncid, int varid, const char *name, nc_type xtype, size_t len, const float *op);
extern int nc_get_att_float(int ncid, int varid, const char *name, float *ip);
extern int nc_put_att_double(int ncid, int varid, const char *name, nc_type xtype, size_t len, const double *op);
extern int nc_get_att_double(int ncid, int varid, const char *name, double *ip);
extern int nc_put_att_ushort(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned short *op);
extern int nc_get_att_ushort(int ncid, int varid, const char *name, unsigned short *ip);
extern int nc_put_att_uint(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned int *op);
extern int nc_get_att_uint(int ncid, int varid, const char *name, unsigned int *ip);
extern int nc_put_att_longlong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const long long *op);
extern int nc_get_att_longlong(int ncid, int varid, const char *name, long long *ip);
extern int nc_put_att_ulonglong(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned long long *op);
extern int nc_get_att_ulonglong(int ncid, int varid, const char *name, unsigned long long *ip);
extern int nc_def_var(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp, int *varidp);
extern int nc_inq_var(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp);
extern int nc_inq_varid(int ncid, const char *name, int *varidp);
extern int nc_inq_varname(int ncid, int varid, char *name);
extern int nc_inq_vartype(int ncid, int varid, nc_type *xtypep);
extern int nc_inq_varndims(int ncid, int varid, int *ndimsp);
extern int nc_inq_vardimid(int ncid, int varid, int *dimidsp);
extern int nc_inq_varnatts(int ncid, int varid, int *nattsp);
extern int nc_rename_var(int ncid, int varid, const char *name);
extern int nc_copy_var(int ncid_in, int varid, int ncid_out);
extern int nc_put_var1_text(int ncid, int varid, const size_t *indexp, const char *op);
extern int nc_get_var1_text(int ncid, int varid, const size_t *indexp, char *ip);
extern int nc_put_var1_uchar(int ncid, int varid, const size_t *indexp, const unsigned char *op);
extern int nc_get_var1_uchar(int ncid, int varid, const size_t *indexp, unsigned char *ip);
extern int nc_put_var1_schar(int ncid, int varid, const size_t *indexp, const signed char *op);
extern int nc_get_var1_schar(int ncid, int varid, const size_t *indexp, signed char *ip);
extern int nc_put_var1_short(int ncid, int varid, const size_t *indexp, const short *op);
extern int nc_get_var1_short(int ncid, int varid, const size_t *indexp, short *ip);
extern int nc_put_var1_int(int ncid, int varid, const size_t *indexp, const int *op);
extern int nc_get_var1_int(int ncid, int varid, const size_t *indexp, int *ip);
extern int nc_put_var1_long(int ncid, int varid, const size_t *indexp, const long *op);
extern int nc_get_var1_long(int ncid, int varid, const size_t *indexp, long *ip);
extern int nc_put_var1_float(int ncid, int varid, const size_t *indexp, const float *op);
extern int nc_get_var1_float(int ncid, int varid, const size_t *indexp, float *ip);
extern int nc_put_var1_double(int ncid, int varid, const size_t *indexp, const double *op);
extern int nc_get_var1_double(int ncid, int varid, const size_t *indexp, double *ip);
extern int nc_put_var1_ushort(int ncid, int varid, const size_t *indexp, const unsigned short *op);
extern int nc_get_var1_ushort(int ncid, int varid, const size_t *indexp, unsigned short *ip);
extern int nc_put_var1_uint(int ncid, int varid, const size_t *indexp, const unsigned int *op);
extern int nc_get_var1_uint(int ncid, int varid, const size_t *indexp, unsigned int *ip);
extern int nc_put_var1_longlong(int ncid, int varid, const size_t *indexp, const long long *op);
extern int nc_get_var1_longlong(int ncid, int varid, const size_t *indexp, long long *ip);
extern int nc_put_var1_ulonglong(int ncid, int varid, const size_t *indexp, const unsigned long long *op);
extern int nc_get_var1_ulonglong(int ncid, int varid, const size_t *indexp, unsigned long long *ip);
extern int nc_put_var1_string(int ncid, int varid, const size_t *indexp, const char **op);
extern int nc_get_var1_string(int ncid, int varid, const size_t *indexp, char **ip);
extern int nc_put_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, const char *op);
extern int nc_get_vara_text(int ncid, int varid, const size_t *startp, const size_t *countp, char *ip);
extern int nc_put_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op);
extern int nc_get_vara_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip);
extern int nc_put_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const signed char *op);
extern int nc_get_vara_schar(int ncid, int varid, const size_t *startp, const size_t *countp, signed char *ip);
extern int nc_put_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, const short *op);
extern int nc_get_vara_short(int ncid, int varid, const size_t *startp, const size_t *countp, short *ip);
extern int nc_put_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, const int *op);
extern int nc_get_vara_int(int ncid, int varid, const size_t *startp, const size_t *countp, int *ip);
extern int nc_put_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, const long *op);
extern int nc_get_vara_long(int ncid, int varid, const size_t *startp, const size_t *countp, long *ip);
extern int nc_put_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, const float *op);
extern int nc_get_vara_float(int ncid, int varid, const size_t *startp, const size_t *countp, float *ip);
extern int nc_put_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, const double *op);
extern int nc_get_vara_double(int ncid, int varid, const size_t *startp, const size_t *countp, double *ip);
extern int nc_put_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned short *op);
extern int nc_get_vara_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned short *ip);
extern int nc_put_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned int *op);
extern int nc_get_vara_uint(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned int *ip);
extern int nc_put_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const long long *op);
extern int nc_get_vara_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, long long *ip);
extern int nc_put_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned long long *op);
extern int nc_get_vara_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned long long *ip);
extern int nc_put_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, const char **op);
extern int nc_get_vara_string(int ncid, int varid, const size_t *startp, const size_t *countp, char **ip);
extern int nc_put_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char *op);
extern int nc_get_vars_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char *ip);
extern int nc_put_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op);
extern int nc_get_vars_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip);
extern int nc_put_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const signed char *op);
extern int nc_get_vars_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, signed char *ip);
extern int nc_put_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const short *op);
extern int nc_get_vars_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, short *ip);
extern int nc_put_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const int *op);
extern int nc_get_vars_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, int *ip);
extern int nc_put_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long *op);
extern int nc_get_vars_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long *ip);
extern int nc_put_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const float *op);
extern int nc_get_vars_float(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, float *ip);
extern int nc_put_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const double *op);
extern int nc_get_vars_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, double *ip);
extern int nc_put_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned short *op);
extern int nc_get_vars_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned short *ip);
extern int nc_put_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned int *op);
extern int nc_get_vars_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned int *ip);
extern int nc_put_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const long long *op);
extern int nc_get_vars_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, long long *ip);
extern int nc_put_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned long long *op);
extern int nc_get_vars_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned long long *ip);
extern int nc_put_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const char **op);
extern int nc_get_vars_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, char **ip);
extern int nc_put_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const char *op);
extern int nc_get_varm_text(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, char *ip);
extern int nc_put_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const unsigned char *op);
extern int nc_get_varm_uchar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, unsigned char *ip);
extern int nc_put_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const signed char *op);
extern int nc_get_varm_schar(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, signed char *ip);
extern int nc_put_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const short *op);
extern int nc_get_varm_short(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, short *ip);
extern int nc_put_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const int *op);
extern int nc_get_varm_int(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, int *ip);
extern int nc_put_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const long *op);
extern int nc_get_varm_long(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, long *ip);
extern int nc_put_varm_float(int ncid, int varid,const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const float *op);
extern int nc_get_varm_float(int ncid, int varid,const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, float *ip);
extern int nc_put_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t *imapp, const double *op);
extern int nc_get_varm_double(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, double *ip);
extern int nc_put_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const unsigned short *op);
extern int nc_get_varm_ushort(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, unsigned short *ip);
extern int nc_put_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const unsigned int *op);
extern int nc_get_varm_uint(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, unsigned int *ip);
extern int nc_put_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const long long *op);
extern int nc_get_varm_longlong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, long long *ip);
extern int nc_put_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const unsigned long long *op);
extern int nc_get_varm_ulonglong(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, unsigned long long *ip);
extern int nc_put_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const char **op);
extern int nc_get_varm_string(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, char **ip);
extern int nc_put_var_text(int ncid, int varid, const char *op);
extern int nc_get_var_text(int ncid, int varid, char *ip);
extern int nc_put_var_uchar(int ncid, int varid, const unsigned char *op);
extern int nc_get_var_uchar(int ncid, int varid, unsigned char *ip);
extern int nc_put_var_schar(int ncid, int varid, const signed char *op);
extern int nc_get_var_schar(int ncid, int varid, signed char *ip);
extern int nc_put_var_short(int ncid, int varid, const short *op);
extern int nc_get_var_short(int ncid, int varid, short *ip);
extern int nc_put_var_int(int ncid, int varid, const int *op);
extern int nc_get_var_int(int ncid, int varid, int *ip);
extern int nc_put_var_long(int ncid, int varid, const long *op);
extern int nc_get_var_long(int ncid, int varid, long *ip);
extern int nc_put_var_float(int ncid, int varid, const float *op);
extern int nc_get_var_float(int ncid, int varid, float *ip);
extern int nc_put_var_double(int ncid, int varid, const double *op);
extern int nc_get_var_double(int ncid, int varid, double *ip);
extern int nc_put_var_ushort(int ncid, int varid, const unsigned short *op);
extern int nc_get_var_ushort(int ncid, int varid, unsigned short *ip);
extern int nc_put_var_uint(int ncid, int varid, const unsigned int *op);
extern int nc_get_var_uint(int ncid, int varid, unsigned int *ip);
extern int nc_put_var_longlong(int ncid, int varid, const long long *op);
extern int nc_get_var_longlong(int ncid, int varid, long long *ip);
extern int nc_put_var_ulonglong(int ncid, int varid, const unsigned long long *op);
extern int nc_get_var_ulonglong(int ncid, int varid, unsigned long long *ip);
extern int nc_put_var_string(int ncid, int varid, const char **op);
extern int nc_get_var_string(int ncid, int varid, char **ip);
extern int nc_reclaim_data(int ncid, nc_type xtypeid, void* memory, size_t count);
extern int nc_reclaim_data_all(int ncid, nc_type xtypeid, void* memory, size_t count);
extern int nc_copy_data(int ncid, nc_type xtypeid, const void* memory, size_t count, void* copy);
extern int nc_copy_data_all(int ncid, nc_type xtypeid, const void* memory, size_t count, void** copyp);
extern int nc_dump_data(int ncid, nc_type xtypeid, void* memory, size_t count, char** buf);
extern int nc_put_att_ubyte(int ncid, int varid, const char *name, nc_type xtype, size_t len, const unsigned char *op);
extern int nc_get_att_ubyte(int ncid, int varid, const char *name, unsigned char *ip);
extern int nc_put_var1_ubyte(int ncid, int varid, const size_t *indexp, const unsigned char *op);
extern int nc_get_var1_ubyte(int ncid, int varid, const size_t *indexp, unsigned char *ip);
extern int nc_put_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const unsigned char *op);
extern int nc_get_vara_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, unsigned char *ip);
extern int nc_put_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const unsigned char *op);
extern int nc_get_vars_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, unsigned char *ip);
extern int nc_put_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, const unsigned char *op);
extern int nc_get_varm_ubyte(int ncid, int varid, const size_t *startp, const size_t *countp, const ptrdiff_t *stridep, const ptrdiff_t * imapp, unsigned char *ip);
extern int nc_put_var_ubyte(int ncid, int varid, const unsigned char *op);
extern int nc_get_var_ubyte(int ncid, int varid, unsigned char *ip);
extern int nc_set_log_level(int new_level);
enum { NC_TURN_OFF_LOGGING = -1 };
extern int nc_show_metadata(int ncid);
extern int nc_delete(const char *path);
extern int nc__create_mp(const char *path, int cmode, size_t initialsz, int basepe, size_t *chunksizehintp, int *ncidp);
extern int nc__open_mp(const char *path, int mode, int basepe, size_t *chunksizehintp, int *ncidp);
extern int nc_delete_mp(const char *path, int basepe);
extern int nc_set_base_pe(int ncid, int pe);
extern int nc_inq_base_pe(int ncid, int *pe);
extern int nctypelen(nc_type datatype);
/* #define FILL_BYTE       NC_FILL_BYTE ### string, not number "NC_FILL_BYTE" */
/* #define FILL_CHAR       NC_FILL_CHAR ### string, not number "NC_FILL_CHAR" */
enum { FILL_SHORT = -32767 };
enum { FILL_LONG = -2147483647 };
/* #define FILL_FLOAT      NC_FILL_FLOAT ### string, not number "NC_FILL_FLOAT" */
/* #define FILL_DOUBLE     NC_FILL_DOUBLE ### string, not number "NC_FILL_DOUBLE" */
enum { MAX_NC_DIMS = 1024 };
enum { MAX_NC_ATTRS = 8192 };
enum { MAX_NC_VARS = 8192 };
enum { MAX_NC_NAME = 256 };
enum { MAX_VAR_DIMS = 1024 };
extern int ncerr;
enum { NC_ENTOOL = -53 };
enum { NC_EXDR = -32 };
enum { NC_SYSERR = -31 };
enum { NC_FATAL = 1 };
enum { NC_VERBOSE = 2 };
extern int ncopts;
extern void nc_advise(const char *cdf_routine_name, int err, const char *fmt,...);
typedef int nclong;
extern int nccreate(const char* path, int cmode);
extern int ncopen(const char* path, int mode);
extern int ncsetfill(int ncid, int fillmode);
extern int ncredef(int ncid);
extern int ncendef(int ncid);
extern int ncsync(int ncid);
extern int ncabort(int ncid);
extern int ncclose(int ncid);
extern int ncinquire(int ncid, int *ndimsp, int *nvarsp, int *nattsp, int *unlimdimp);
extern int ncdimdef(int ncid, const char *name, long len);
extern int ncdimid(int ncid, const char *name);
extern int ncdiminq(int ncid, int dimid, char *name, long *lenp);
extern int ncdimrename(int ncid, int dimid, const char *name);
extern int ncattput(int ncid, int varid, const char *name, nc_type xtype, int len, const void *op);
extern int ncattinq(int ncid, int varid, const char *name, nc_type *xtypep, int *lenp);
extern int ncattget(int ncid, int varid, const char *name, void *ip);
extern int ncattcopy(int ncid_in, int varid_in, const char *name, int ncid_out, int varid_out);
extern int ncattname(int ncid, int varid, int attnum, char *name);
extern int ncattrename(int ncid, int varid, const char *name, const char *newname);
extern int ncattdel(int ncid, int varid, const char *name);
extern int ncvardef(int ncid, const char *name, nc_type xtype, int ndims, const int *dimidsp);
extern int ncvarid(int ncid, const char *name);
extern int ncvarinq(int ncid, int varid, char *name, nc_type *xtypep, int *ndimsp, int *dimidsp, int *nattsp);
extern int ncvarput1(int ncid, int varid, const long *indexp, const void *op);
extern int ncvarget1(int ncid, int varid, const long *indexp, void *ip);
extern int ncvarput(int ncid, int varid, const long *startp, const long *countp, const void *op);
extern int ncvarget(int ncid, int varid, const long *startp, const long *countp, void *ip);
extern int ncvarputs(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const void *op);
extern int ncvargets(int ncid, int varid, const long *startp, const long *countp, const long *stridep, void *ip);
extern int ncvarputg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, const void *op);
extern int ncvargetg(int ncid, int varid, const long *startp, const long *countp, const long *stridep, const long *imapp, void *ip);
extern int ncvarrename(int ncid, int varid, const char *name);
extern int ncrecinq(int ncid, int *nrecvarsp, int *recvaridsp, long *recsizesp);
extern int ncrecget(int ncid, long recnum, void **datap);
extern int ncrecput(int ncid, long recnum, void *const *datap);
extern int nc_initialize(void);
extern int nc_finalize(void);
extern char* nc_rc_get(const char* key);
extern int nc_rc_set(const char* key, const char* value);
enum { NC_HAVE_RENAME_GRP = 1 };
enum { NC_HAVE_INQ_FORMAT_EXTENDED = 1 };
enum { NC_HAVE_META_H = 1 };
/* + END   /usr/include/netcdf.h */
]]
return require 'ffi.load' 'netcdf'
